home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
gnu
/
recode.lha
/
recode-3.2.4
/
asciltex.l
< prev
next >
Wrap
Text File
|
1992-08-26
|
2KB
|
63 lines
%{
/* Conversion of files between different charsets and usages.
Copyright (C) 1990 Free Software Foundation, Inc.
Francois Pinard <pinard@iro.umontreal.ca>, 1988.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#define STEP ascii_latex
extern int diacritics_only;
%}
%%
# { if (!diacritics_only) output ('\\'); output ('#'); }
\$ { if (!diacritics_only) output ('\\'); output ('$'); }
% { if (!diacritics_only) output ('\\'); output ('%'); }
& { if (!diacritics_only) output ('\\'); output ('&'); }
_ { if (!diacritics_only) output ('\\'); output ('_'); }
\{ { if (!diacritics_only) output ('\\'); output ('{'); }
\} { if (!diacritics_only) output ('\\'); output ('}'); }
\\ { const char *cursor;
if (diacritics_only)
output ('\\');
else
for (cursor = "\\backslash{}"; *cursor; cursor++)
output (*cursor);
}
\"\b\<|\<\b\" { output ('`'); output ('`'); }
\"\b\>|\>\b\" { output ('\''); output ('\''); }
'\b[Ee] { output ('\\'); output ('\''); output (yytext[2]); }
[Ee]\b' { output ('\\'); output ('\''); output (yytext[0]); }
[`^"]\b[AaEeIOoUu] { output ('\\'); output (yytext[0]);
output (yytext[2]); }
[`^"]\bi { output ('\\'); output (yytext[0]); output ('\\');
output ('i'); output (' '); }
[AaEeIOoUu]\b[`^"] { output ('\\'); output (yytext[2]);
output (yytext[0]); }
i\b[`^"] { output ('\\'); output (yytext[2]); output ('\\');
output ('i'); output (' '); }
\,\b[Cc] { output ('\\'); output ('c'); output ('{');
output (yytext[2]); output ('}'); }
[Cc]\b\, { output ('\\'); output ('c'); output ('{');
output (yytext[0]); output ('}'); }